angular.module("controller.notification", [ "services" ]).controller(
		"notificationCtrl",
		[
				"$scope", 
				"apiService",
				"alertManager",
				function($scope, apiService, alertManager) {
					$scope.data = {};
					$scope.data.notifications = [];
					$scope.data.pagination = {
						current : 0,
						size : 10,
					};
					$scope.data.changePage = function() {
						$scoep.data.getReadNotifications();
					};

					$scope.data.getReadNotifications = function() {
						apiService.getReadNotifications(
								$scope.data.pagination.current,
								$scope.data.pagination.size).then(function(data) {
								$scope.data.notifications = data.content;
						}, function() {
							alertManager.addAlert("danger", "無法獲取消息");
						})
					};
					$scope.data.getReadNotifications();
				} ]);